package com.binary.markdownrecord.config.snowflake;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;

@Configuration
@Order(1)
public class BeanConfig {
    @Value("${service.workId:0}")
    private long workId;
    @Value("${service.dataCenterId:0}")
    private long dataCenterId;


    @Bean
    public SnowflakeIdWorker SnowflakeIdWorker() {
        return new SnowflakeIdWorker(workId, dataCenterId);
    }

   
}
